﻿using IRepository.SystemDefault;
using Model.SystemDefault;
using System;
using System.Collections.Generic;
using System.Text;
using Dapper;
using System.Linq;
using ModelCache;

namespace Repository.SystemDefault
{
    public class CollectorTaskRepository : BaseRepository<CollecttorTaskModel>, ICollectorTaskRepository
    {
        public IEnumerable<CollecttorTaskModel> GetCollecttorTaskListByStatus(CollectStatus collectStatus, string constr)
        {
            using (var con = GetDbConnection(constr))
            {
                var sql = string.Format("{0} where CollectStatus=@CollectStatus", ModelCache<CollecttorTaskModel>._GetAllSql, ModelCache<CollecttorTaskModel>._PrimaryKey);
                return con.Query<CollecttorTaskModel>(sql, new { CollectStatus = collectStatus});
            }
        }
    }
}
